<?php
/**
 * @file messagesystem.php $
 * @author LiangJian (liangjian@haibao.com) $
 * @date 2015年10月20日 下午7:00:52 $
 * @brief  $
 */
namespace haibao\www\data\message;

class MessageSystem extends \haibao\www\data\BaseMysql{

    public function __construct(){
        parent::__construct('\haibao\www\model\data\message\MessageSystem');
		$this->setConfig( \haibao\classlibrary\www\Config::CLASSLIBRARY_CONFIG_MYSQL_HAIBAO_USER );
    }

    public function globalSystemMessage($lastSyncTime){
        if(!$lastSyncTime){
            return false;
        }
        $sql = 'select * from MessageSystem where UserRange=%s and CreateTime>%s order by Id asc';
        $result = $this->query($sql, array(
            \haibao\www\model\data\message\MessageSystem::USER_RANGE_ALL,
            $lastSyncTime
        ));
        $retArr = array();
        while ($row = $result->fetch_assoc()) {
            array_push($retArr, $row);
        }
        return $retArr;
    }
} 